<?php
	$_title='个人主页|我的账号';
	include_once 'head.php';
	//左侧导航
	$my_label='account';
	$smarty->assign('my_label',$my_label);		
	$userc=new user();
	// $user_id=2;


	//读取作者个人信息
	if($user_id!='' && $user_id!=null){
		// $key='i.*';
		// $user=$userc->userInfo($user_id,$key);
		// $smarty->assign('user',$user);
	}else{
		header('Location:login.php');
	}	
	// $smarty->assign('user',$user);

	if(@$_POST['submit']){
		$pwd=$_POST['pwd'];

		$arr=array('pwd'=>md5($pwd),);
		$res=$userc->userInfoUpdate($arr,'id="'.$user_id.'"');
		if($res==1){
			$msg='密码修改成功！';
		}else{
			$msg="密码修改失败！";
		}
		$url='my_account_pwd.php';
		echo $commonc->submitAlert($msg,$url);
		exit();
			
	}

	//html模板区分
	$html='my_account_pwd.html';
	$smarty->display($html);		
?>